import axios from 'axios'
// 首页轮播图（大）
export const upHomeSwiper = (file) => {
  return axios({
    method: 'post',
    url: '/api/add_carousel',
    params: {
      image: file
    }
  })
}

export const getHomeSwiper = () => {
  return axios({
    method: 'post',
    url: '/api/findAllcarousel'
  })
}
// 删除一个
export const delHomeSwiper = (id) => {
  return axios({
    method: 'get',
    url: '/api/delete_carousel',
    params: {
      id
    }
  })
}

// 删除多个
export const delNumHomeSwiper = (ids) => {
  return axios({
    method: 'post',
    url: '/api/deleteAll_carousel',
    params: {
      ids
    }
  })
}

// 首页轮播图（小）
// 增加
export const upHomeSwiperSmall = (file) => {
  return axios({
    method: 'post',
    url: '/api/add_carousel2',
    params: {
      image: file
    }
  })
}
// 获取
export const getHomeSwiperSmall = () => {
  return axios({
    method: 'post',
    url: '/api/findAllcarousel2'
  })
}
// 删除一个
export const delHomeSwiperSmall = (id) => {
  return axios({
    method: 'get',
    url: '/api/delete_carousel',
    params: {
      id
    }
  })
}

// 删除多个
export const delNumHomeSwiperSmall = (ids) => {
  return axios({
    method: 'post',
    url: '/api/deleteAll_carousel2',
    params: {
      ids
    }
  })
}

// 精品页面轮播图
// 上传
export const upShopSwiper = (file) => {
  return axios({
    method: 'post',
    url: '/api/add_carousel3',
    params: {
      image: file
    }
  })
}
// 获取
export const getShopSwiper = () => {
  return axios({
    method: 'post',
    url: '/api/findAllcarousel3'
  })
}
// 删除一个
export const delShopSwiper = (id) => {
  return axios({
    method: 'get',
    url: '/api/delete_carousel3',
    params: {
      id
    }
  })
}

// 删除多个
export const delNumShopSwiper = (ids) => {
  return axios({
    method: 'post',
    url: '/api/deleteAll_carousel3',
    params: {
      ids
    }
  })
}
